package com.huike.web.controller.clues;

import com.huike.clues.domain.dto.toFollowClue;
import com.huike.clues.service.ITbClueService;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/clues/record")
public class ToFollowCluesController {

    @Autowired
    private ITbClueService tbClueService;

    @PostMapping
    public AjaxResult insertToFollowInfo(@RequestBody toFollowClue toFollowClue){
        tbClueService.insertToFollowInfo(toFollowClue);
        return AjaxResult.success("添加成功");
    }


    @GetMapping("/list")
    public TableDataInfo getToFollowInfoByclueID(Long clueId){
        List<toFollowClue> toFollowList = tbClueService.getToFollowList(clueId);
        return new TableDataInfo(toFollowList,toFollowList.size());
    }



//    @GetMapping(value = "/{id}")
//    public TableDataInfo getInfo(@PathVariable("id") Long id) {
//        return TableDataInfo.success(tbClueService.getToFollowList(id));
//    }


}
